package cn.com.bsoft.wePortal.message.contorller

import cn.com.bsoft.wePortal.msg.service.MessagePublisher
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.ResponseBody

@Controller
@RequestMapping("/message")
class MessageController{

    @Autowired
    lateinit var messagePublisher: MessagePublisher

    @RequestMapping("/")
    @ResponseBody
    fun index():Map<String,String>{

        messagePublisher.publish("hello world!")

        return mapOf("result" to "OK")
    }
}